home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / net / sun4c.md / netLEMachInt.h < prev    next >
C/C++ Source or Header  |  1991-03-19  |  2KB  |  57 lines

  1. /*
  2.  * netLEMachInt.h --
  3.  *
  4.  *    Internal definitions for the sun4c LANCE controller.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef _NETLEMACHINT
  17. #define _NETLEMACHINT
  18.  
  19. #include <netInt.h>
  20.  
  21. /*
  22.  * Register address port and register data port definition.
  23.  */
  24.  
  25. typedef struct NetLEMach_Reg {
  26.     volatile unsigned short    dataPort;    /* RDP */
  27.         volatile unsigned short    addrPort[1];    /* RAP */
  28. } NetLEMach_Reg;
  29.  
  30. #define NET_LE_REG_SIZE    4
  31.  
  32. /*
  33.  * On the sun4c we don't have to copy packets because they are mapped
  34.  * into DVMA space.
  35.  */
  36.  
  37. #define NET_LE_COPY_PACKET FALSE
  38.  
  39. /*
  40.  * Macros for converting chip to cpu and cpu to chip address.
  41.  * We always deal with chip addresses in two parts, the lower 16 bits
  42.  * and the upper 8 bits.
  43.  */
  44. #define    NET_LE_FROM_CHIP_ADDR(statePtr, high,low)    \
  45.         ((Address) (0xff000000 + ((high) << 16) + (low)))
  46.  
  47. #define    NET_LE_TO_CHIP_ADDR_LOW(a) ( ((unsigned int) (a)) & 0xffff)
  48. #define    NET_LE_TO_CHIP_ADDR_HIGH(a) ( (((unsigned int) (a)) >> 16) & 0xff)
  49.  
  50. /* 
  51.  * Routine to allocate a network buffer.
  52.  */
  53. #define BufAlloc(statePtr, numBytes) \
  54.     (char *) VmMach_NetMemAlloc(numBytes);
  55.  
  56. #endif /* _NETLEMACHINT */
  57.